<template>
  <div class="count">
    <h2>Count组件</h2>
    <button @click="getParent($parent)">获取父组件的组件实例</button>
  </div>
</template>

<script lang="ts">
import {defineComponent} from "vue";

export default defineComponent({
  name: "Count",
});

</script>

<script lang="ts" setup>
const getParent = (parent: any) => {
  console.log(parent.countApp)
}
</script>

<style scoped>
.count {
  background-color: pink;
}
</style>